﻿<%@ Page Title="" Language="C#" MasterPageFile="~/ZFMaster.Master" AutoEventWireup="true"
    CodeBehind="Estatelist.aspx.cs" Inherits="ZF.WS.info.Estatelist" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="location mb10_">
        您现在的位置：<a href="/"><%=SiteInfo.Instance.SystemConfig.SiteName %></a>>> <a href="<%=this.Request.Url %>">
            新楼盘列表</a>
    </div>
    <table>
        <tr>
            <td style="width: 200px" valign="top">
            
                <div class="left dn_">
                    <div class=" board menu mmenu">
                        <zf:ListView runat="server" ID="lvPTitle">
                            <LayoutTemplate>
                                <zf:PlaceHolder ID="itemPlaceHolder" runat="server">
                                </zf:PlaceHolder>
                            </LayoutTemplate>
                            <ItemTemplate>
                            
                                <dl class='<%#Container.DataItemIndex == 0 ? "" : "slideDown"%>'>
                                    <dt><span>&nbsp;</span><a href='Estatelist.aspx?aid=<%#Eval("Id") %>'><%#Eval("Name") %></a>
                                    </dt>
                                    <zf:ListView ID="ListView1" runat="server" DataSource='<%#Eval("Childs") %>'>
                                        <LayoutTemplate>
                                            <zf:PlaceHolder ID="itemPlaceHolder" runat="server">
                                            </zf:PlaceHolder>
                                        </LayoutTemplate>
                                        <ItemTemplate>
                                            <dd>
                                                <a href='Estatelist.aspx?aid=<%#Eval("Id") %>'>
                                                    <%#Eval("Name") %></a>
                                            </dd>
                                        </ItemTemplate>
                                    </zf:ListView>
                                </dl>
                            </ItemTemplate>
                        </zf:ListView>
                    </div>
                </div>
                <div class="board infosearch lrsearch  " style="width: 200px">
                    <dl>
                        <dt><span>新楼盘搜索</span> </dt>
                        <dd>
                            <% var sp = new ZF.WS.house.Search(); %>
                            <table class="w100_  ">
                            
                                <tr>
                                    <td class='t'>
                                        区域:
                                    </td>
                                    <td class='c'>
                                        <select class="ddl at">
                                            <option value="0">不 限</option>
                                            <%foreach (var t in sp.City)
                                              { %>
                                            <option value="<%=t.AreaId %>">
                                                <%=t.Name %></option>
                                            <%} %>
                                        </select>
                                        
 
                                        <script>
                                            $("select.at").change(function() {
                                                $(".tdca select").hide();
                                                $(".tdca").find(String.format("select[@paid={0}]", this.value)).show();
                                            });
                                        </script>
                                    </td>
                                </tr>
                                <tr>
                                    <td class='t'>
                                        商圈:
                                    </td>
                                    <td class='c tdca'>
                                        <select class="ddl" paid="0">
                                            <option value="0">不 限&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>
                                        </select>
                                        <%foreach (var area in sp.AreaChilds)
                                          { %>
                                        <select class="ddl dn_" paid="<%=area.Id %>">
                                            <option value="0">不 限</option>
                                            <%foreach (var a in area.Childs)
                                              { %>
                                            <option value="<%=a.Id %>">
                                                <%=a.Name%></option>
                                            <%} %>
                                        </select>
                                        <%} %>
                                         
                                    </td>
                                </tr>
                                <tr>
                                    <td class='t'>
                                        物业类型:
                                    </td>
                                    <td class='c'>
                                        <select class="ddl ht">
                                            <option value="0">不 限</option>
                                            <%foreach (var t in ZF.BLL.DictionaryConfig.HHouseType)
                                              { %>
                                            <option value="<%=t.Key %>">
                                                <%=t.Text %></option>
                                            <%} %>
                                        </select>
                                    </td>
                                </tr>
                                <tr>
                                    <td class='t'>
                                        价格范围:
                                    </td>
                                    <td class='c'>
                                        <input type="text" class="sstxt pmin" />-<input type="text" class="sstxt pmax" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class='t'>
                                        发布时间:
                                    </td>
                                    <td class='c'>
                                        <select class="ddl days">
                                            <option value="0">不限</option>
                                            <option value="3">三天以内</option>
                                            <option value="7">七天以内</option>
                                            <option value="15">半个月以内</option>
                                            <option value="3">一个月以内</option>
                                        </select>
                                    </td>
                                </tr>
                                <tr>
                                    <td class='t'>
                                        物业名称:
                                    </td>
                                    <td class='c'>
                                        <input type="text" class="stxt key" />
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2" style="text-align: center">
                                        <input type="button" value=" 搜 索 " class="btSearch" />
                                    </td>
                                </tr>
                            </table>
                        </dd>
                    </dl>
                </div>

                <script>
                    $(function() {
                        var infosearch = $(".infosearch");
                        infosearch.find(".btSearch").click(function() {
                            var param = "1=1";
                            if (infosearch.find(".at")[0].value != "0")
                                param += "&aid1=" + infosearch.find(".at")[0].value;
                            if (infosearch.find(String.format(".tdca select[@paid={0}]", infosearch.find(".at")[0].value))[0].value != "0") {
                                param += "&aid2=" + infosearch.find(String.format(".tdca select[@paid={0}]", infosearch.find(".at")[0].value))[0].value;
                            }
                            
                            if (infosearch.find(".ht")[0].value != "0")
                                param += "&ht=" + infosearch.find(".ht")[0].value;
                            if ($.trim(infosearch.find(".pmin").val()) != "")
                                param += "&pmin=" + $.trim(infosearch.find(".pmin").val());
                            if ($.trim(infosearch.find(".pmax").val()) != "")
                                param += "&pmax=" + $.trim(infosearch.find(".pmax").val());
                            if (infosearch.find(".days")[0].value != "0")
                                param += "&days=" + infosearch.find(".days")[0].value;
                            if ($.trim(infosearch.find(".key").val()) != "")
                                param += "&key=" + infosearch.find(".key").val();

                            window.location = encodeURI("/house/Estatelist.aspx?" + param);

                        });
                    });
                </script>

            </td>
            <td style="width: 10px" valign="top">
            </td>
            <td style="width: 760px" valign="top">
                <style>
                    .info .p1, .info .p2 { width: 400px; }
                    .info th { text-align: left; color: #009900; height: 30px; vertical-align: top; }
                    .info td { height: 70px; border-bottom: 1px solid #eee; }
                </style>
                <div class="board info  w100_ " style="width: 100%">
                    <dl>
                        <dt>
                            <p>
                                新楼盘信息</p>
                          <%--  <a href="EstatePub.aspx?dt=1" class="more" style="width: 100px">发布新楼盘</a> --%></dt>
                        <dd>
                            <zf:ListView ID="lvList" runat="server">
                                <LayoutTemplate>
                                    <table class="w100_   ">
                                        <tr>
                                            <th>
                                                图片
                                            </th>
                                            <th>
                                                物业名称/物业地址
                                            </th>
                                            <th>
                                                物业类型
                                            </th>
                                            <th>
                                                （元/平米）
                                            </th>
                                            <th>
                                                发布日期
                                            </th>
                                        </tr>
                                        <zf:PlaceHolder ID="itemPlaceHolder" runat="server">
                                        </zf:PlaceHolder>
                                    </table>
                                </LayoutTemplate>
                                <ItemTemplate>
                                    <tr>
                                        <td style="width: 60px">
                                            <a href="/house/EstateInfo.aspx?hid=<%#Eval("House.EstateId")%>">
                                                <img src="/photo/house/<%#Eval("House.FirstPhoto") %>" style="width: 60px; height: 60px" /></a>
                                        </td>
                                        <td valign="top" style="width: 115px; overflow: hidden">
                                            <p class="p1">
                                                <%--<span style="color: #A651A6">(<%#Eval("City") %>)</span>--%>
                                               [<%#Eval("City") %>] <a href="/house/EstateInfo.aspx?hid=<%#Eval("House.EstateId") %>">
                                                    <%#Eval("House.Title") %></a>
                                            </p>
                                            <br />
                                            <p class="p2">
                                                <%# string.Concat(Eval("House.Address")).MaxLength(30)%></p>
                                        </td>
                                        <td style="width: 85px">
                                            <a href="/house/EstateInfo.aspx?hid=<%#Eval("House.EstateId") %>">
                                                <%#Eval("Type") %></a>
                                        </td>
                                        <td style="width: 85px">
                                            <a href="/house/EstateInfo.aspx?hid=<%#Eval("House.EstateId")%>">
                                                <%#Eval("House.Price")%>元/m2</a>
                                        </td>
                                        <td>
                                            <%# ((DateTime)Eval("House.AddTime")).ToShortDateString()%>
                                        </td>
                                    </tr>
                                </ItemTemplate>
                            </zf:ListView>
                        </dd>
                        <dd class="page">
                            <table>
                                <tr>
                                    <td>
                                        <a href="<%=_param %>&pi=0">首 页</a> <a href="<%=_param %>&pi=<%=this.Pi > 0 ? Pi - 1 : 0 %>">
                                            上一页</a> <a href="<%=_param %>&pi=<%=this.Pi+1 %>">下一页</a> <a href="<%=_param %>&pi=999999">
                                                未 页</a> &nbsp;
                                    </td>
                                </tr>
                            </table>
                        </dd>
                    </dl>
                </div>
            </td>
        </tr>
    </table>
</asp:Content>
